package com.gyz.cfmall.config;

import com.gyz.cfmall.interceptor.CartInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author gong_yz
 * @Description
 * @Date 2023/4/18
 */

@Configuration
public class CfmallWebConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注册拦截器
        registry.addInterceptor(new CartInterceptor()).addPathPatterns("/**");
    }
}
